package com.ruoyi.project.mealOrde.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.mealOrde.mapper.MealOrderMapper;
import com.ruoyi.project.mealOrde.domain.MealOrder;
import com.ruoyi.project.mealOrde.service.IMealOrderService;

/**
 * 套餐订单Service业务层处理
 * 
 * @author wyh
 * @date 2024-08-16
 */
@Service
public class MealOrderServiceImpl implements IMealOrderService 
{
    @Autowired
    private MealOrderMapper mealOrderMapper;

    /**
     * 查询套餐订单
     * 
     * @param outTradeNo 套餐订单主键
     * @return 套餐订单
     */
    @Override
    public MealOrder selectMealOrderByOutTradeNo(String outTradeNo)
    {
        return mealOrderMapper.selectMealOrderByOutTradeNo(outTradeNo);
    }

    /**
     * 查询套餐订单列表
     * 
     * @param mealOrder 套餐订单
     * @return 套餐订单
     */
    @Override
    public List<MealOrder> selectMealOrderList(MealOrder mealOrder)
    {
        return mealOrderMapper.selectMealOrderList(mealOrder);
    }

    /**
     * 新增套餐订单
     * 
     * @param mealOrder 套餐订单
     * @return 结果
     */
    @Override
    public int insertMealOrder(MealOrder mealOrder)
    {
        mealOrder.setCreateTime(DateUtils.getNowDate());
        return mealOrderMapper.insertMealOrder(mealOrder);
    }

    /**
     * 修改套餐订单
     * 
     * @param mealOrder 套餐订单
     * @return 结果
     */
    @Override
    public int updateMealOrder(MealOrder mealOrder)
    {
        mealOrder.setUpdateTime(DateUtils.getNowDate());
        return mealOrderMapper.updateMealOrder(mealOrder);
    }

    /**
     * 批量删除套餐订单
     * 
     * @param outTradeNos 需要删除的套餐订单主键
     * @return 结果
     */
    @Override
    public int deleteMealOrderByOutTradeNos(String[] outTradeNos)
    {
        return mealOrderMapper.deleteMealOrderByOutTradeNos(outTradeNos);
    }

    /**
     * 删除套餐订单信息
     * 
     * @param outTradeNo 套餐订单主键
     * @return 结果
     */
    @Override
    public int deleteMealOrderByOutTradeNo(String outTradeNo)
    {
        return mealOrderMapper.deleteMealOrderByOutTradeNo(outTradeNo);
    }
}
